package chapter3.No3_3_类ThreadLocal的使用.demo1;

/**
 * *：ThreadLocal的get()和返回null
 * Created by Administrator on 2016/11/20.
 */
public class Main {
    static ThreadLocal tl = new ThreadLocal();

    public static void main(String[] args) {
        if(tl.get() == null) {
            System.out.println("我现在没有值");
            tl.set("我有值了");
        }
        System.out.println(tl.get());
        System.out.println(tl.get());
    }
}
